<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改原材料')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-spu-edit" th:object="${spu}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">来源ID：</label>
                <div class="col-sm-8">
                    <input name="sourceId" th:field="*{sourceId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">原料编号：</label>
                <div class="col-sm-8">
                    <input name="spuCode" th:field="*{spuCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">供应商编码：</label>
                <div class="col-sm-8">
                    <input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">所属品类：</label>
                <div class="col-sm-8">
                    <input name="categoryId" th:field="*{categoryId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否包装盒 0原料，1包装合 默认0：</label>
                <div class="col-sm-8">
                    <input name="isPackingBox" th:field="*{isPackingBox}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">温区编码：</label>
                <div class="col-sm-8">
                    <input name="temperatureZoneCode" th:field="*{temperatureZoneCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">商品主图：</label>
                <div class="col-sm-8">
                    <input name="imgUrl" th:field="*{imgUrl}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">保质期(品类保质期预留，入库单输入保质期为主，供应商乱输保质期不管，入库单保质期>原料保质期>品类保质期)：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="shelfLife" th:value="${#dates.format(spu.shelfLife, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">货箱重量误差范围最小值(n/g)：</label>
                <div class="col-sm-8">
                    <input name="errorMin" th:field="*{errorMin}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">货箱重量误差范围最大值(n/g)：</label>
                <div class="col-sm-8">
                    <input name="errorMax" th:field="*{errorMax}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" th:field="*{remark}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否大件0:否,1:是：</label>
                <div class="col-sm-8">
                    <input name="bigProduct" th:field="*{bigProduct}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否标品，0：否；1：是：</label>
                <div class="col-sm-8">
                    <input name="standard" th:field="*{standard}" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/spu/ad";
        $("#form-spu-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-spu-edit').serialize());
            }
        }

        $("input[name='shelfLife']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>